import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    list: [],
    types: 'Villa',
  },
  mutations: {
    LIST_MUTATION(state, data) {
      state.list = data;
    },
    TYPES_MUTATION(state, data) {
      state.types = data;
    },
  },
  actions: {
    setList({ commit, state }) {
      commit('LIST_MUTATION', state);
    },
  },
});
